#include<iostream>
#include<cstdio>
#include<map>
using namespace std;
typedef long long LL;
map<LL, int>mp;
const int N = 1e6 + 10;
int n;
int pre[N];
int a[N];
LL fun(int x)
{
	LL ans = 0;
	for (int i = 1; i * i <= x; i++) {
		if (x % i == 0) {
			ans += i;
			if (x / i != i) {
				ans += x / i;
			}
		}
	}
	return ans - x;
}
//int fun(int x)
//{
//	int ans = 0;
//	for (int i = 1; i < x; i++) {
//		if (x % i == 0) {
//			ans += i;
//		}
//	}
//	return ans;
//}
int main()
{
	cin >> n;
	//cout << fun(10000000) << endl;
    //cout << fun(11) << endl;
	//cout << fun(66928) << endl;
	cout << fun(220) << endl;
	cout << fun(226) << endl;
	int ans1 = 0, ans2 = 0;
	//cout << fun(206) << endl;

	for (int i = 1;; i++) {
		if (mp[i] == 1 && fun(i) == pre[i] && pre[i] >= n) {
			ans1 = pre[i];
			ans2 = i;
			//cout << ans1 << " " << ans2 << endl;
			break;
		}
		LL x = fun(i);
		//cout << "x==" << x << endl;
		mp[x] = 1;
		pre[x] = i;
	}
	cout << ans1 << " " << ans2 << endl;
	return 0;
}